diff --git a/README.md b/README.md index f49393cd..9fffb4f2 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ $ pwa-asset-generator --help -m --manifest Web app manifest file path to automatically update manifest file with the generated icons -i --index Index HTML file path to automatically put splash screen and icon meta tags in -a --path Path prefix to prepend for href links generated for meta tags - -h --path-override Override the path of images used in href/src tags of manifest and HTML files + -v --path-override Override the path of images used in href/src tags of manifest and HTML files -t --type Image type: png|jpg|jpeg [default: png] -q --quality Image quality: 0...100 (Only for JPEG) [default: 100] -h --splash-only Only generate splash screens [default: false] diff --git a/src/cli.test.ts b/src/cli.test.ts index 34462752..ae4eb775 100644 --- a/src/cli.test.ts +++ b/src/cli.test.ts @@ -1,4 +1,5 @@ import execa from 'execa'; +import constants from './config/constants'; describe('CLI', () => { test('throws error when input is not provided', async () => { @@ -30,4 +31,11 @@ describe('CLI', () => { } expect(response.stdout).toMatchSnapshot(); }); + + test('does not have any conflicting shorthand options', () => { + const flagShorthands = Object.values(constants.FLAGS).map( + (flag) => flag.alias, + ); + expect(new Set(flagShorthands).size).toBe(flagShorthands.length); + }); }); diff --git a/src/cli.ts b/src/cli.ts index 6035f6cf..df55eba9 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -20,7 +20,7 @@ $ pwa-asset-generator --help -m --manifest Web app manifest file path to automatically update manifest file with the generated icons -i --index Index HTML file path to automatically put splash screen and icon meta tags in -a --path Path prefix to prepend for href links generated for meta tags - -h --path-override Override the path of images used in href/src tags of manifest and HTML files + -v --path-override Override the path of images used in href/src tags of manifest and HTML files -t --type Image type: png|jpg|jpeg [default: png] -q --quality Image quality: 0...100 (Only for JPEG) [default: 100] -h --splash-only Only generate splash screens [default: false] diff --git a/src/config/constants.ts b/src/config/constants.ts index 885fff37..3c02b996 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -48,7 +48,7 @@ export default { }, pathOverride: { type: 'string', - alias: 'h', + alias: 'v', }, opaque: { type: 'boolean', @@ -245,13 +245,25 @@ export default { /* eslint-disable */ if (orientation === 'portrait') { return `\ - + `; } // As weird as it gets, Apple expects same device width and height values from portrait orientation, for landscape return `\ - + `; /* eslint-enable */ },