mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
projects.py: Add command "commands"
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
aedb473999
commit
1d22dfa49f
1 changed files with 16 additions and 1 deletions
|
|
@ -152,8 +152,22 @@ def get_ldflags(names):
|
|||
return r[1::]
|
||||
return ''
|
||||
|
||||
def commands():
|
||||
f = open(sys.argv[0])
|
||||
cmds = []
|
||||
for line in f:
|
||||
debug("checking line ", line)
|
||||
rr = re.findall('^def *cmd_([a-z0-9_]+).*', line)
|
||||
if len(rr):
|
||||
cmds.append(rr[0].replace('_', '-'))
|
||||
f.close()
|
||||
return ' '.join(cmds)
|
||||
|
||||
# --------------------------------------------------------------------- commands
|
||||
|
||||
def cmd_commands(args_):
|
||||
print(commands())
|
||||
|
||||
def cmd_test(args_):
|
||||
parser = argparse.ArgumentParser(description='Test')
|
||||
parser.add_argument('blah', default='', help='The blah argument')
|
||||
|
|
@ -261,7 +275,8 @@ top_name = None
|
|||
|
||||
parser = argparse.ArgumentParser(description='Project metadata evaluation')
|
||||
parser.add_argument('cmd', default='', help='Command')
|
||||
parser.add_argument('--debug', '-d', nargs='?', const=True, default=False, help='Output debug information to stderr')
|
||||
parser.add_argument('--debug', '-d', action='store_true',
|
||||
default=False, help='Output debug information to stderr')
|
||||
parser.add_argument('--topdir', '-t', nargs='?', help='Project Path')
|
||||
parser.add_argument('--prefix', '-p', nargs='?', default = expanduser("~") +
|
||||
'/local/src/cvs.stable/proj', help='Projects Path Prefix')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue