• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

victorperin / qr-scanner-cli / 7770727734

04 Feb 2024 01:24AM UTC coverage: 92.929%. Remained the same
7770727734

push

github

victorperin
fix(mutation): update stryker

19 of 24 branches covered (0.0%)

Branch coverage included in aggregate %.

73 of 75 relevant lines covered (97.33%)

19.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/cli/execution.ts
1
import yargs from 'yargs'
24✔
2

3
import { scanFromFileOnCli } from '../pipelines/scanFromFile'
24✔
4

5
import { greenBox } from '../infrastructure/boxen'
24✔
6
import flags from './flags'
24✔
7

8
const execution = async (args: string[]): Promise<void> => {
24✔
9
  const yargsInstance = yargs(args)
24✔
10
    .strict()
11
    .example([
12
      ['qrscanner ./qrCode.jpg', greenBox('This message is written in a QR Code', { margin: 1 })],
13
      ['qrscanner ./qrCode.jpg --clear', '\nThis message is written in a QR Code'],
14
    ])
15
    .command('$0 <file>', 'Scan a QR Code from a file')
16
    .positional('file', {
17
      describe: 'Path to the file to scan',
18
      type: 'string',
19
      demandOption: true,
20
    })
21
    .options(flags)
22
    .help()
23

24
  const argv = await yargsInstance.argv
24✔
25

26
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
  const { _, $0, file, ...flagsTreated } = argv
20✔
28

29
  return scanFromFileOnCli(file, flagsTreated).catch((error: Error) => {
20✔
30
    console.error(error.message)
8✔
31
    return yargsInstance.exit(1, error)
8✔
32
  })
33
}
34

35
export default execution
24✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc