-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli
executable file
·29 lines (20 loc) · 846 Bytes
/
cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env lua
local argparse = require "argparse"
local ansicolors = require "ansicolors"
local pformat = require 'thirdparty_libs.pprint'.pformat
--local user_command_factory = require 'cli_commands.user'
--local actions = require "sailor.cli"`
local parser = argparse()
:name(string.match(arg[0], "/*(%w+)/*$")) -- this file name, usually will be "sailor"
:epilog("For more info see http://sailorproject.org")
-- :require_command(false)
-- TODO commands
-- TODO security! check user name == owner of sctipt
--local user_command = user_command_factory.create(parser)
--parser:flag("-v --version", "Show the current Sailor version installed and exit.", false):action(actions.version)
-- TODO how else configure default actions?
if not arg[1] then
arg[1] = '-h'
end
parser:usage(parser:get_help())
local args = parser:parse()