simplified group spec
This commit is contained in:
parent
3d6c59d8e5
commit
4f719c9d7c
15
main
15
main
|
@ -7,6 +7,9 @@
|
||||||
from os import path as ospath;
|
from os import path as ospath;
|
||||||
from os import system as ossystem;
|
from os import system as ossystem;
|
||||||
import sys;
|
import sys;
|
||||||
|
import re;
|
||||||
|
|
||||||
|
grpMatcher = re.compile(r'^:(.+):$');
|
||||||
|
|
||||||
|
|
||||||
# get absolute path
|
# get absolute path
|
||||||
|
@ -20,10 +23,9 @@ def showhelp():
|
||||||
print;
|
print;
|
||||||
print "\033[1mSYNOPSIS\033[0m"
|
print "\033[1mSYNOPSIS\033[0m"
|
||||||
print "\tapt-plus <command> <packages>";
|
print "\tapt-plus <command> <packages>";
|
||||||
print "\tapt-plus -g <group> <command> <packages>";
|
print "\tapt-plus :<group>: <command> <packages>";
|
||||||
print "\tapt-plus --gropu <group> <command> <packages>";
|
|
||||||
print;
|
print;
|
||||||
print "\t-g, --group <group>";
|
print "\t<group>";
|
||||||
print "\t\tProccess actions within a specific group (applies to: install, purge, remove, list, deb install).";
|
print "\t\tProccess actions within a specific group (applies to: install, purge, remove, list, deb install).";
|
||||||
print;
|
print;
|
||||||
print "\033[1mDESCRIPTION\033[0m"
|
print "\033[1mDESCRIPTION\033[0m"
|
||||||
|
@ -75,9 +77,10 @@ if ( len(sys.argv) > 1 ):
|
||||||
#--------------------------------------------------------#
|
#--------------------------------------------------------#
|
||||||
OPTGROUP = None;
|
OPTGROUP = None;
|
||||||
ARGS = sys.argv;
|
ARGS = sys.argv;
|
||||||
if( len(sys.argv) > 2 and sys.argv[1] == "-g" or sys.argv[1] == "--group" ):
|
match = grpMatcher.search(sys.argv[1]);
|
||||||
OPTGROUP = sys.argv[2];
|
if( len(sys.argv) > 2 and match != None ):
|
||||||
ARGS = ARGS[0:1] + ARGS[3:];
|
OPTGROUP = match.group(1);
|
||||||
|
ARGS = ARGS[0:1] + ARGS[2:];
|
||||||
|
|
||||||
# (2) Normal arguments
|
# (2) Normal arguments
|
||||||
#--------------------------------------------------------#
|
#--------------------------------------------------------#
|
||||||
|
|
Loading…
Reference in New Issue