├── .eslintrc.json ├── .github └── workflows │ └── node.js.yml ├── .gitignore ├── .prettierrc ├── .taprc ├── CHANGES.md ├── LICENSE.txt ├── Makefile ├── README.md ├── TODO.txt ├── etc └── dashdash.bash_completion.in ├── examples ├── custom-option-arrayOfCommaSepString.js ├── custom-option-duration.js ├── custom-option-fruit.js ├── custom-option-intGteZero.js ├── custom-option-time-ago.js ├── date.js ├── ddcompletion.js ├── foo.js ├── hello.js ├── help.js └── option-groups.js ├── lib └── dashdash.js ├── package-lock.json ├── package.json └── test └── basics.test.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "prettier" 4 | ], 5 | "extends": [ 6 | "eslint:recommended", 7 | "plugin:prettier/recommended" 8 | ], 9 | "parserOptions": { 10 | "ecmaVersion": 6, 11 | "sourceType": "script", 12 | "ecmaFeatures": { 13 | } 14 | }, 15 | "env": { 16 | "node": true 17 | }, 18 | "rules": { 19 | "curly": ["error", "all"], 20 | "func-names": ["error", "always"] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source 2 | # code and run tests across different versions of node. 3 | # https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 4 | 5 | name: Node.js CI 6 | 7 | on: 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | jobs: 14 | # Check lint and style. 15 | check: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - uses: actions/setup-node@v1 20 | with: 21 | node-version: '12.x' 22 | - run: npm ci 23 | - run: npm run check 24 | 25 | # Test once on every (available) plat, using LTS node version. 26 | test-plats: 27 | strategy: 28 | matrix: 29 | os: [ubuntu-latest, windows-latest, macos-latest] 30 | runs-on: ${{ matrix.os }} 31 | steps: 32 | - uses: actions/checkout@v2 33 | - uses: actions/setup-node@v1 34 | with: 35 | node-version: '12.x' 36 | - run: npm ci 37 | - run: npm test 38 | 39 | # Test once for every supported node version. Only test on one 40 | # platform to not overkill the number of builds. 41 | test-vers: 42 | strategy: 43 | matrix: 44 | node: ['10.x', '12.x', '14.x'] 45 | runs-on: ubuntu-latest 46 | steps: 47 | - uses: actions/checkout@v2 48 | - uses: actions/setup-node@v1 49 | with: 50 | node-version: ${{ matrix.node }} 51 | - run: npm ci 52 | - run: npm test 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tmp 2 | /node_modules 3 | /npm-debug.log 4 | /.nyc_output 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "useTabs": false, 4 | "semi": true, 5 | "trailingComma": "none", 6 | 7 | "bracketSpacing": false, 8 | "singleQuote": true, 9 | "tabWidth": 4 10 | } 11 | -------------------------------------------------------------------------------- /.taprc: -------------------------------------------------------------------------------- 1 | check-coverage: false 2 | coverage: false 3 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # node-dashdash changelog 2 | 3 | ## not yet released 4 | 5 | (nothing yet) 6 | 7 | ## 2.0.0 8 | 9 | - [Backward incompatible change] This version drops official support for 10 | versions of node.js before 10.x. Dashdash 1.x supports back to node 0.10.x. 11 | I've no direct intention of breaking compat, but new changes won't be tested 12 | on older node versions. Moving to a newer node allows me to switch to a 13 | modernish node-tap for better testing. 14 | 15 | Dev changes: 16 | - Switch from nodeunit to node-tap for testing. 17 | - Switch from jsstyle to eslint for linting, and prettier for formatting. 18 | - Prefix release tags with a "v", e.g. "v2.0.0", as is I think more typical 19 | with other projects. 20 | 21 | ## 1.14.1 22 | 23 | - [issue #30] Change the output used by dashdash's Bash completion support to 24 | indicate "there are no completions for this argument" to cope with different 25 | sorting rules on different Bash/platforms. For example: 26 | 27 | $ triton -v -p test2 package get # before 28 | ##-no -tritonpackage- completions-## 29 | 30 | $ triton -v -p test2 package get # after 31 | ##-no-completion- -results-## 32 | 33 | ## 1.14.0 34 | 35 | - New `synopsisFromOpt(