Skip to content

Commit

Permalink
✨ feat: add -v flag for version
Browse files Browse the repository at this point in the history
  • Loading branch information
Rettend committed Jan 21, 2024
1 parent f597f01 commit 7aa58e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- [ ] `strict (boolean) [false]` - do not allow any commits without emojis
- [ ] `conventional (boolean) [true]` - only allow conventional commits, this package should work without conventional commits as well
- [ ] new option: `mode (overwrite|append) [append]` - overwrite or append the config (for both json and ts) (idea: if emoji prop is specified, overwrite, else use default + you can import the default emojis to append them)
- [ ] add `-v` alias for `--version`
- [x] add `-v` alias for `--version`
- [ ] make the consola start and success logs sane in the cleanup command
- [ ] rewrite the bin files in typescript and also build them
- [ ] refactor a lot!
Expand Down
12 changes: 11 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineCommand } from 'citty'
import { consola } from 'consola'
import { description, name, version } from '../package.json'
import { commands } from './commands'

Expand All @@ -8,6 +9,15 @@ export const main = defineCommand({
version,
description,
},
args: {
version: {
alias: 'v',
type: 'boolean',
},
},
subCommands: commands,
run() {},
run({ args }) {
if (args.version)
consola.log(`😎 ${name} v${version}`)
},
})

0 comments on commit 7aa58e5

Please sign in to comment.