Skip to content

Commit 4ab3767

Browse files
committed
fix help Error.
1 parent 5e2e624 commit 4ab3767

File tree

2 files changed

+79
-81
lines changed

2 files changed

+79
-81
lines changed

Modifed/PyFileManager.py

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def argument_help(self, Args):
348348
if Args[1] == '-h' and Args[0] == 'mv':
349349
print("Usage: mv [-h] src [src ...] dest\n\nMove(Rename) a file or directory to a new name, or into a new directory.")
350350
if Args[1] == '-h' and Args[0] == 'ping':
351-
print("Usage: ping [-h] [-c COUNT] Destination\n\nSend ping to network hosts.")
351+
print("Usage: ping [-h] [iP]\nDestination\n\nSend ping to network hosts.")
352352
if Args[1] == '-h' and Args[0] == 'rm':
353353
print("Usage: rm [-h] paths [paths ...]")
354354
if Args[1] == '-h' and Args[0] == 'python':
@@ -714,10 +714,10 @@ def Argument_Paser(self, Args):
714714
pass
715715
try:
716716
if Args[0] == 'help':
717-
print('[Default commands]:\nhelp, 2to3, cat, cd, echo, env, git(clone only), la, ls, ln, mkdir, open, ping, rm, tar, uznip, wget, zip, python, python3, pbcopy, pbpaste, delclip, showip, exit\n\n[Third Party commands]:\n' + self.list_other_cmd() + '\n\n[Stash Extensions Commands]:\n' + self.list_stash_bin())
717+
print('[Default commands]:\nhelp, 2to3, cat, cd, echo, env, git(clone only), la, ls, ln, mkdir, open, ping, rm, tar, uznip, wget, zip, python, python3, qrcode, pbcopy, pbpaste, delclip, showip, exit\n\n[Third Party commands]:\n' + self.list_other_cmd() + '\n\n[Stash Extensions Commands]:\n' + self.list_stash_bin())
718718
elif Args[0] == 'cat':
719719
try:
720-
if not Args[1] == '-h' or not Args[1] == '--help':
720+
if not Args[1] == '-h':
721721
ViewFile = self.readfile(Args[1])
722722
if ViewFile[0] == '0':
723723
try:
@@ -726,19 +726,17 @@ def Argument_Paser(self, Args):
726726
print('Error: Read Text File?')
727727
elif ViewFile[0] == '3':
728728
print('{}'.format(console.show_image(Args[1])).split('None')[0])
729-
else:
730-
print('ERROR: Readed MediaFiles?')
731729
else:
732-
self.argument_help(Args)
730+
pass
733731
except Exception as E:
734732
print(E)
735733
pass
736734
elif Args[0] == '2to3':
737735
try:
738-
if not Args[1] == '-h' or not Args[1] == '--help':
736+
if not Args[1] == '-h':
739737
self._2to3(Args[1:])
740738
else:
741-
self.argument_help(Args)
739+
pass
742740
except:
743741
pass
744742
elif Args[0] == 'pbcopy':
@@ -766,7 +764,7 @@ def Argument_Paser(self, Args):
766764
pass
767765
elif Args[0] == 'cd':
768766
try:
769-
if not Args[1] == '-h' or not Args[1] == '--help':
767+
if not Args[1] == '-h':
770768
if '$' in Args[1] and '/' in Args[1]:
771769
Arg1 = Args[1].replace('$', os.getenv(Args[1].split('$')[1].split('/')[0]))
772770
Args[1] = Args.replace(Args[1].split('$')[1].split('/')[0], '')
@@ -794,26 +792,26 @@ def Argument_Paser(self, Args):
794792
except:
795793
pass
796794
else:
797-
self.argument_help(Args)
795+
pass
798796
except:
799797
try:
800798
os.chdir(self.HOME_DIC)
801799
except Exception as E:
802800
print('ERROR:{}'.format(E))
803801
elif Args[0] == 'cp':
804802
try:
805-
if not Args[1] == '-h' or not Args[1] == '--help':
803+
if not Args[1] == '-h':
806804
if not '/' in Args[2]:
807805
self.copyFiles(os.path.join(os.getcwd(),Args[1]),os.path.join(os.getcwd(), Args[2]))
808806
else:
809807
self.copyFiles(os.path.join(os.getcwd(),Args[1]), Args[2])
810808
else:
811-
self.argument_help(Args)
809+
pass
812810
except:
813811
pass
814812
elif Args[0] == 'echo':
815813
try:
816-
if not Args[1] == '-h' or not Args[1] == '--help':
814+
if not Args[1] == '-h':
817815
try:
818816
if Args[1][0] == '$':
819817
env_data = os.getenv(Args[1][1:])
@@ -822,7 +820,7 @@ def Argument_Paser(self, Args):
822820
except:
823821
pass
824822
else:
825-
self.argument_help(Args)
823+
pass
826824
except IndexError:
827825
print('')
828826
except:
@@ -838,31 +836,31 @@ def Argument_Paser(self, Args):
838836
pass
839837
elif Args[0] == 'git':
840838
try:
841-
if not Args[1] == '-h' or not Args[1] == '--help':
839+
if not Args[1] == '-h':
842840
if Args[1] == 'clone':
843841
self.git_clone(Args[2:])
844842
else:
845843
print('git is clone only')
846844
else:
847-
self.argument_help(Args)
845+
pass
848846
except:
849847
pass
850848
elif Args[0] == 'la' or Args[0] == 'ls':
851849
try:
852-
if not Args[1] == '-h' or not Args[1] == '--help':
850+
if not Args[1] == '-h':
853851
if Args[1] == '-l':
854852
self.listdir('long', os.getcwd())
855853
else:
856854
self.listdir(None, None)
857855
else:
858-
self.argument_help(Args)
856+
pass
859857
except IndexError:
860858
self.listdir(None, None)
861859
except:
862860
pass
863861
elif Args[0] == 'ln':
864862
try:
865-
if not Args[1] == '-h' or not Args[1] == '--help':
863+
if not Args[1] == '-h':
866864
if Args[1] == '-s':
867865
try:
868866
if not '/' in Args[2] and not '/' in Args[3]:
@@ -880,7 +878,7 @@ def Argument_Paser(self, Args):
880878
except:
881879
pass
882880
else:
883-
self.argument_help(Args)
881+
pass
884882
except:
885883
pass
886884
elif Args[0] == 'pip':
@@ -904,59 +902,59 @@ def Argument_Paser(self, Args):
904902
pass
905903
elif Args[0] == 'mkdir':
906904
try:
907-
if not Args[1] == '-h' or not Args[1] == '--help':
905+
if not Args[1] == '-h':
908906
if Args[1] == '-p':
909907
os.makedirs(Args[2], exist_ok=True)
910908
else:
911909
os.makedirs(Args[1], exist_ok=True)
912910
else:
913-
self.argument_help(Args)
911+
pass
914912
except:
915913
pass
916914
elif Args[0] == 'qrcode':
917915
try:
918-
if not Args[1] == '-h' or not Args[1] == '--help':
916+
if not Args[1] == '-h':
919917
with QRCodeView(Args[1]) as QR:
920918
print('{}'.format(console.show_image(QR)).split('None')[0])
921919
else:
922-
self.argument_help(Args)
920+
pass
923921
except:
924922
pass
925923
elif Args[0] == 'mv':
926924
try:
927-
if not Args[1] == '-h' or not Args[1] == '--help':
925+
if not Args[1] == '-h':
928926
try:
929927
shutil.move(Args[1], Args[2])
930928
except IndexError:
931929
pass
932930
except Exception as E:
933931
print(E)
934932
else:
935-
self.argument_help(Args)
933+
pass
936934
except:
937935
pass
938936
elif Args[0] == 'open':
939937
try:
940-
if not Args[1] == '-h' or not Args[1] == '--help':
938+
if not Args[1] == '-h':
941939
try:
942940
console.quicklook(Args[1])
943941
except Exception as E:
944942
print(E)
945943
else:
946-
self.argument_help(Args)
944+
pass
947945
except:
948946
pass
949947
elif Args[0] == 'ping':
950948
try:
951-
if not Args[1] == '-h' or not Args[1] == '--help':
949+
if not Args[1] == '-h':
952950
try:
953951
for _P in range(3):
954952
print(self.ping(Args[1]))
955953
time.sleep(1)
956954
except:
957955
pass
958956
else:
959-
self.argument_help(Args)
957+
pass
960958
except:
961959
pass
962960
elif Args[0] == 'pwd':
@@ -967,7 +965,7 @@ def Argument_Paser(self, Args):
967965
print(path)
968966
elif Args[0] == 'rm':
969967
try:
970-
if not Args[1] == '-h' or not Args[1] == '--help':
968+
if not Args[1] == '-h':
971969
try:
972970
if '$' in Args[1] and '/' in Args[1]:
973971
Arg1 = Args[1].replace('$', os.getenv(Args[1].split('$')[1].split('/')[0]))
@@ -989,28 +987,28 @@ def Argument_Paser(self, Args):
989987
except Exception as E:
990988
print(E)
991989
else:
992-
self.argument_help(Args)
990+
pass
993991
except:
994992
pass
995993
elif Args[0] == 'tar':
996994
try:
997-
if not Args[1] == '-h' or not Args[1] == '--help':
995+
if not Args[1] == '-h':
998996
self.TarArgument(Args)
999997
else:
1000-
self.argument_help(Args)
998+
pass
1001999
except:
10021000
pass
10031001
elif Args[0] == 'unzip':
10041002
try:
1005-
if not Args[1] == '-h' or not Args[1] == '--help':
1003+
if not Args[1] == '-h':
10061004
self.ZIPExtractor(Args[1])
10071005
else:
1008-
self.argument_help(Args)
1006+
pass
10091007
except:
10101008
pass
10111009
elif Args[0] == 'python' or Args[0] == 'python3' or Args[0] == 'py' or Args[0] == 'py3':
10121010
try:
1013-
if not Args[1] == '-h' or not Args[1] == '--help':
1011+
if not Args[1] == '-h':
10141012
if not '/' in Args[1]:
10151013
file_path = os.path.join(os.getcwd(), Args[1])
10161014
else:
@@ -1021,7 +1019,7 @@ def Argument_Paser(self, Args):
10211019
except:
10221020
pass
10231021
else:
1024-
self.argument_help(Args)
1022+
pass
10251023
except IndexError:
10261024
try:
10271025
code.interact()
@@ -1031,25 +1029,25 @@ def Argument_Paser(self, Args):
10311029
pass
10321030
elif Args[0] == 'wget':
10331031
try:
1034-
if not Args[1] == '-h' or not Args[1] == '--help':
1032+
if not Args[1] == '-h':
10351033
try:
10361034
if Args[2] == '-o' or Args[2] == '--output':
10371035
self.wget(Args[1], filename=Args[3])
10381036
except IndexError:
10391037
self.wget(Args[1])
10401038
else:
1041-
self.argument_help(Args)
1039+
pass
10421040
except:
10431041
pass
10441042
elif Args[0] == 'zip':
10451043
try:
1046-
if not Args[1] == '-h' or not Args[1] == '--help':
1044+
if not Args[1] == '-h':
10471045
try:
10481046
self.ZipArchiveCreate(Args[1], Args[2])
10491047
except:
10501048
pass
10511049
else:
1052-
self.argument_help(Args)
1050+
pass
10531051
except:
10541052
pass
10551053
elif Args[0] == 'exit':

0 commit comments

Comments
 (0)