mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Made the man opening code cleaner
This commit is contained in:
@@ -34,7 +34,7 @@ def main():
|
|||||||
# action='store_true')
|
# action='store_true')
|
||||||
|
|
||||||
parser.add_option('--man',
|
parser.add_option('--man',
|
||||||
help="Read the manual",
|
help="Read the manual and exit.",
|
||||||
default=False,
|
default=False,
|
||||||
action='store_true')
|
action='store_true')
|
||||||
|
|
||||||
@@ -56,16 +56,17 @@ def main():
|
|||||||
# return
|
# return
|
||||||
|
|
||||||
if options.man:
|
if options.man:
|
||||||
|
import shlex
|
||||||
print("Which man page?")
|
print("Which man page?")
|
||||||
print("1) wavinfo usage")
|
print("1) wavinfo usage")
|
||||||
print("7) General info on Wave file metadata")
|
print("7) General info on Wave file metadata")
|
||||||
m = input("?> ")
|
m = input("?> ")
|
||||||
|
|
||||||
if m.startswith("1"):
|
args = ["man", "-M", manpath, "1", "wavinfo"]
|
||||||
os.system(f"man -M {manpath} 1 wavinfo")
|
if m.startswith("7"):
|
||||||
elif m.startswith("7"):
|
args[3] = "7"
|
||||||
os.system(f"man -M {manpath} 7 wavinfo")
|
|
||||||
|
|
||||||
|
os.system(shlex.join(args))
|
||||||
return
|
return
|
||||||
|
|
||||||
for arg in args[1:]:
|
for arg in args[1:]:
|
||||||
|
|||||||
Reference in New Issue
Block a user