linux-command 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {linux-command-0.2.1 → linux-command-0.2.2}/PKG-INFO +1 -1
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command/linux_command.py +14 -14
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command.egg-info/PKG-INFO +1 -1
- {linux-command-0.2.1 → linux-command-0.2.2}/LICENSE +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/README.md +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command/__init__.py +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command.egg-info/SOURCES.txt +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command.egg-info/dependency_links.txt +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command.egg-info/entry_points.txt +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/linux_command.egg-info/top_level.txt +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/setup.cfg +0 -0
- {linux-command-0.2.1 → linux-command-0.2.2}/setup.py +0 -0
|
@@ -31,7 +31,7 @@ import glob
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
# Define the version
|
|
34
|
-
VERSION = "0.2.
|
|
34
|
+
VERSION = "0.2.2"
|
|
35
35
|
PROJECT_URL = "https://github.com/MouxiaoHuang/linux-command"
|
|
36
36
|
|
|
37
37
|
|
|
@@ -76,6 +76,14 @@ commands = {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
def custom_help():
|
|
80
|
+
print("Available commands:")
|
|
81
|
+
for command, description in commands.items():
|
|
82
|
+
print(f'[{command}]: {description}')
|
|
83
|
+
print(f"For more information, visit: {PROJECT_URL}")
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
79
87
|
def confirm_action(message):
|
|
80
88
|
"""Ask the user to confirm an action, accepting y/n or yes/no"""
|
|
81
89
|
confirmation = input(f"{message} (yes/no or y/n): ").strip().lower()
|
|
@@ -91,29 +99,21 @@ def main():
|
|
|
91
99
|
)
|
|
92
100
|
|
|
93
101
|
parser.add_argument('-h', '--help', action='store_true', help='Show this help message and exit')
|
|
94
|
-
parser.add_argument('-V', '
|
|
102
|
+
parser.add_argument('-V', '--version', action='store_true', help='Show program\'s version number and exit')
|
|
95
103
|
|
|
96
104
|
# Main command and subcommands
|
|
97
|
-
parser.add_argument('command',
|
|
105
|
+
parser.add_argument('command', nargs='?', help='Command to execute')
|
|
98
106
|
parser.add_argument('extra', nargs='*', help='Additional arguments for the command')
|
|
99
107
|
|
|
100
108
|
# Parse the arguments
|
|
101
109
|
args = parser.parse_args()
|
|
102
110
|
|
|
103
111
|
if args.help:
|
|
104
|
-
|
|
105
|
-
# Show help for a specific command
|
|
106
|
-
print(f'{args.command}: {commands.get(args.command, "No help available for this command.")}')
|
|
107
|
-
else:
|
|
108
|
-
# Show help for all commands
|
|
109
|
-
print("Available commands:")
|
|
110
|
-
for command, description in commands.items():
|
|
111
|
-
print(f' {command}: {description}')
|
|
112
|
-
print("\nUse 'cmd -h [command]' to see help for a specific command.")
|
|
112
|
+
custom_help()
|
|
113
113
|
return
|
|
114
114
|
|
|
115
|
-
if
|
|
116
|
-
|
|
115
|
+
if args.version:
|
|
116
|
+
print(f'linux-command {VERSION}')
|
|
117
117
|
return
|
|
118
118
|
|
|
119
119
|
# `ls` commands
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|