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

victorperin / qr-scanner-cli / 7492198815

11 Jan 2024 05:14PM UTC coverage: 92.929%. First build
7492198815

Pull #217

github

web-flow
Merge fd721e8fd into 17c8abc20
Pull Request #217: Bugfix: updates

19 of 24 branches covered (0.0%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

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
  const { _, $0, file, ...flagsTreated } = argv
20✔
27

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

34
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