add "edit" command to open config file
This commit is contained in:
parent
39019f5df0
commit
7dc36feaa3
@ -216,7 +216,8 @@ def main():
|
||||
parser.description = 'run commands on any distribution'
|
||||
parser.add_argument('osname',
|
||||
help = 'distribution name to run on, '
|
||||
'"list" to dump all available distributions')
|
||||
'"list" to dump all available distributions, '
|
||||
'"edit" to open the current config file in a text editor.')
|
||||
parser.epilog = '(c) 2021 Gilles Grandou <gilles@grandou.net>'
|
||||
|
||||
parser.add_argument('-v', '--verbose', action='store_true',
|
||||
@ -246,6 +247,10 @@ def main():
|
||||
print(' {}'.format(o))
|
||||
print()
|
||||
return 0
|
||||
elif args.osname == 'edit':
|
||||
cmd = [ 'xdg-open', conf_file ]
|
||||
ret = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL);
|
||||
return 0
|
||||
|
||||
if args.link:
|
||||
make_osname_link(sys.argv[0], args.osname)
|
||||
|
Loading…
Reference in New Issue
Block a user