mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
show version number
This commit is contained in:
parent
9538881f9f
commit
6a17444c4c
@ -26,7 +26,7 @@ export const { _: commands, ...flags } = minimist(process.argv.slice(2), {
|
|||||||
string: ['l', 'b'],
|
string: ['l', 'b'],
|
||||||
})
|
})
|
||||||
|
|
||||||
export const VERSION = '0.3'
|
export const VERSION = '0.4'
|
||||||
export const DEFAULT_CONFIG = '/.autorestic.yml'
|
export const DEFAULT_CONFIG = '/.autorestic.yml'
|
||||||
export const INSTALL_DIR = '/usr/local/bin'
|
export const INSTALL_DIR = '/usr/local/bin'
|
||||||
export const CONFIG_FILE: string = resolve(flags.config || homedir() + DEFAULT_CONFIG)
|
export const CONFIG_FILE: string = resolve(flags.config || homedir() + DEFAULT_CONFIG)
|
||||||
@ -34,10 +34,17 @@ export const VERBOSE = flags.verbose
|
|||||||
|
|
||||||
export const config: Config = init()
|
export const config: Config = init()
|
||||||
|
|
||||||
if (commands.length < 1)
|
function main() {
|
||||||
help()
|
if (flags.version)
|
||||||
else {
|
return console.log('version'.grey, VERSION)
|
||||||
|
|
||||||
|
if (commands.length < 1)
|
||||||
|
return help()
|
||||||
|
|
||||||
|
|
||||||
const command: string = commands[0]
|
const command: string = commands[0]
|
||||||
const args: string[] = commands.slice(1)
|
const args: string[] = commands.slice(1)
|
||||||
;(handlers[command] || error)(args, flags)
|
;(handlers[command] || error)(args, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user