Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 88275 Details for
Bug 119674
show error message for unsupported command line options
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
equery-check-args-try1.diff
equery-check-args-try1.diff (text/plain), 8.42 KB, created by
Florian Steinel
on 2006-06-03 10:11:03 UTC
(
hide
)
Description:
equery-check-args-try1.diff
Filename:
MIME Type:
Creator:
Florian Steinel
Created:
2006-06-03 10:11:03 UTC
Size:
8.42 KB
patch
obsolete
>--- /usr/bin/equery 2006-01-19 19:13:28.000000000 +0100 >+++ equery 2006-06-03 19:03:23.000000000 +0200 >@@ -121,16 +121,20 @@ class CmdListFiles(Command): > need_help = 0 > opts = self.default_options > for x in args: >- if x in ["-h", "--help"]: >- need_help = 1 >- elif x in ["--md5sum"]: >- opts["showMD5"] = 1 >- elif x in ["--timestamp"]: >- opts["showTimestamp"] = 1 >- elif x in ["--type"]: >- opts["showType"] = 1 >- elif x[:9] == "--filter=": >- opts["filter"] = string.split(x[9:],',') >+ if x[0:1]=="-": >+ if x in ["-h", "--help"]: >+ need_help = 1 >+ elif x in ["--md5sum"]: >+ opts["showMD5"] = 1 >+ elif x in ["--timestamp"]: >+ opts["showTimestamp"] = 1 >+ elif x in ["--type"]: >+ opts["showType"] = 1 >+ elif x[:9] == "--filter=": >+ opts["filter"] = string.split(x[9:],',') >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > elif x[0] == "/": > die(2, "The query '" + pp.pkgquery(x) + "' does not appear to be a valid package specification") > else: >@@ -297,18 +301,22 @@ class CmdListBelongs(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-c", "--category"]: >- opts["category"] = args[i+1] >- skip = 1 >- elif x in ["-e", "--earlyout"]: >- opts["earlyOut"] = 1 >- elif x in ["-f", "--full-regex"]: >- opts["fullRegex"] = 1 >- elif x in ["-n", "--name-only"]: >- opts["nameOnly"] = 1 >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-c", "--category"]: >+ opts["category"] = args[i+1] >+ skip = 1 >+ elif x in ["-e", "--earlyout"]: >+ opts["earlyOut"] = 1 >+ elif x in ["-f", "--full-regex"]: >+ opts["fullRegex"] = 1 >+ elif x in ["-n", "--name-only"]: >+ opts["nameOnly"] = 1 >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query.append(x) > >@@ -426,11 +434,15 @@ class CmdDisplayUSEs(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-a", "--all"]: >- opts["installedOnly"] = False >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-a", "--all"]: >+ opts["installedOnly"] = False >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -618,13 +630,17 @@ class CmdDisplayDepGraph(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-U","--no-useflags"]: >- opts["displayUSEFlags"] = 0 >- elif x in ["-l","--linear"]: >- opts["fancyFormatting"] = 0 >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-U","--no-useflags"]: >+ opts["displayUSEFlags"] = 0 >+ elif x in ["-l","--linear"]: >+ opts["fancyFormatting"] = 0 >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -719,11 +735,15 @@ class CmdDisplaySize(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-b","--bytes"]: >- opts["reportSizeInBytes"] = 1 >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-b","--bytes"]: >+ opts["reportSizeInBytes"] = 1 >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -807,9 +827,13 @@ class CmdCheckIntegrity(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -917,11 +941,15 @@ class CmdWhich(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-m", "--include-masked"]: >- opts["includeMasked"] = True >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-m", "--include-masked"]: >+ opts["includeMasked"] = True >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -976,15 +1004,19 @@ class CmdListDepends(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-d", "--direct"]: >- opts["onlyDirect"] = 1 >- elif x in ["-D", "--indirect"]: >- opts["onlyDirect"] = 0 >- elif x in ["-a", "--all-packages"]: >- opts["onlyInstalled"] = 0 >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-d", "--direct"]: >+ opts["onlyDirect"] = 1 >+ elif x in ["-D", "--indirect"]: >+ opts["onlyDirect"] = 0 >+ elif x in ["-a", "--all-packages"]: >+ opts["onlyInstalled"] = 0 >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -1145,25 +1177,29 @@ class CmdListPackages(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-i", "--installed"]: >- opts["includeInstalled"] = 1 >- elif x in ["-I", "--exclude-installed"]: >- opts["includeInstalled"] = 0 >- elif x in ["-p", "--portage-tree"]: >- opts["includePortTree"] = 1 >- elif x in ["-o", "--overlay-tree"]: >- opts["includeOverlayTree"] = 1 >- elif x in ["-m", "--exclude-masked"]: >- opts["includeMasked"] = 0 >- elif x in ["-f", "--full-regex"]: >- opts["regex"] = 1 >- elif x in ["-e", "--exact-name"]: >- opts["exact"] = 1 >- elif x in ["-d", "--duplicates"]: >- opts["duplicates"] = 1 >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-i", "--installed"]: >+ opts["includeInstalled"] = 1 >+ elif x in ["-I", "--exclude-installed"]: >+ opts["includeInstalled"] = 0 >+ elif x in ["-p", "--portage-tree"]: >+ opts["includePortTree"] = 1 >+ elif x in ["-o", "--overlay-tree"]: >+ opts["includeOverlayTree"] = 1 >+ elif x in ["-m", "--exclude-masked"]: >+ opts["includeMasked"] = 0 >+ elif x in ["-f", "--full-regex"]: >+ opts["regex"] = 1 >+ elif x in ["-e", "--exact-name"]: >+ opts["exact"] = 1 >+ elif x in ["-d", "--duplicates"]: >+ opts["duplicates"] = 1 >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -1367,19 +1403,23 @@ class CmdFindUSEs(Command): > continue > x = args[i] > >- if x in ["-h","--help"]: >- need_help = 1 >- break >- elif x in ["-i", "--installed"]: >- opts["includeInstalled"] = 1 >- elif x in ["-I", "--exclude-installed"]: >- opts["includeInstalled"] = 0 >- elif x in ["-p", "--portage-tree"]: >- opts["includePortTree"] = 1 >- elif x in ["-o", "--overlay-tree"]: >- opts["includeOverlayTree"] = 1 >- elif x in ["-m", "--exclude-masked"]: >- opts["includeMasked"] = 0 >+ if x[0:1]=="-": >+ if x in ["-h","--help"]: >+ need_help = 1 >+ break >+ elif x in ["-i", "--installed"]: >+ opts["includeInstalled"] = 1 >+ elif x in ["-I", "--exclude-installed"]: >+ opts["includeInstalled"] = 0 >+ elif x in ["-p", "--portage-tree"]: >+ opts["includePortTree"] = 1 >+ elif x in ["-o", "--overlay-tree"]: >+ opts["includeOverlayTree"] = 1 >+ elif x in ["-m", "--exclude-masked"]: >+ opts["includeMasked"] = 0 >+ else: >+ print "!!! Error: "+x+" is an invalid option." >+ sys.exit(1) > else: > query = x > >@@ -1608,18 +1648,22 @@ def parseArgs(args): > x = args[i] > if 0: > pass >- elif x in ["-h", "--help"]: >- showhelp = True >- elif x in ["-V", "--version"]: >- printVersion() >- sys.exit(0) >- elif x in ["-C", "--nocolor"]: >- Config["color"] = 0 >- pp.output.nocolor() >- elif x in ["-N", "--no-pipe"]: >- Config["piping"] = False >- elif x in ["-q","--quiet"]: >- Config["verbosityLevel"] = 0 >+ elif x[0:1]=="-": >+ if x in ["-h", "--help"]: >+ showhelp = True >+ elif x in ["-V", "--version"]: >+ printVersion() >+ sys.exit(0) >+ elif x in ["-C", "--nocolor"]: >+ Config["color"] = 0 >+ pp.output.nocolor() >+ elif x in ["-N", "--no-pipe"]: >+ Config["piping"] = False >+ elif x in ["-q","--quiet"]: >+ Config["verbosityLevel"] = 0 >+ else: >+ print "!!! Error: "+x+" is an invalid tool-specific option." >+ sys.exit(1) > elif expand(x) in Known_commands.keys(): > command = Known_commands[expand(x)] > local_opts = args[i+1:]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 119674
: 88275