Skip to content

Commit

Permalink
Made the man opening code cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvcapra committed Nov 24, 2024
1 parent 29ca62b commit 28e0532
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions wavinfo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def main():
# action='store_true')

parser.add_option('--man',
help="Read the manual",
help="Read the manual and exit.",
default=False,
action='store_true')

Expand All @@ -56,16 +56,17 @@ def main():
# return

if options.man:
import shlex
print("Which man page?")
print("1) wavinfo usage")
print("7) General info on Wave file metadata")
m = input("?> ")

if m.startswith("1"):
os.system(f"man -M {manpath} 1 wavinfo")
elif m.startswith("7"):
os.system(f"man -M {manpath} 7 wavinfo")
args = ["man", "-M", manpath, "1", "wavinfo"]
if m.startswith("7"):
args[3] = "7"

os.system(shlex.join(args))
return

for arg in args[1:]:
Expand Down

0 comments on commit 28e0532

Please sign in to comment.