linux-command 0.0.0__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.0.0/PKG-INFO +28 -0
- linux-command-0.0.0/README.md +15 -0
- linux-command-0.0.0/linux_command/__init__.py +0 -0
- linux-command-0.0.0/linux_command/linux_command.py +23 -0
- linux-command-0.0.0/linux_command.egg-info/PKG-INFO +28 -0
- linux-command-0.0.0/linux_command.egg-info/SOURCES.txt +9 -0
- linux-command-0.0.0/linux_command.egg-info/dependency_links.txt +1 -0
- linux-command-0.0.0/linux_command.egg-info/entry_points.txt +2 -0
- linux-command-0.0.0/linux_command.egg-info/top_level.txt +1 -0
- linux-command-0.0.0/setup.cfg +4 -0
- linux-command-0.0.0/setup.py +25 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: linux-command
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: A command line tool to perform custom tasks.
|
|
5
|
+
Home-page: https://github.com/yourusername/mycommand
|
|
6
|
+
Author: Mouxiao Huang
|
|
7
|
+
Author-email: huangmouxiao@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# linux-command: Linux Command
|
|
15
|
+
|
|
16
|
+
`linux-command` 是一个用于执行特定命令行任务的工具。
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install linux-command
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 使用
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cmd ls-dir
|
|
28
|
+
```
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import argparse
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
parser = argparse.ArgumentParser(description='')
|
|
7
|
+
|
|
8
|
+
parser.add_argument('command', type=str, help='Command to execute')
|
|
9
|
+
parser.add_argument('--key', type=str, default='', help='Keyword for the kill command')
|
|
10
|
+
|
|
11
|
+
args = parser.parse_args()
|
|
12
|
+
|
|
13
|
+
# `ls`
|
|
14
|
+
if args.command == 'ls-dir':
|
|
15
|
+
os.system('ls -lR | grep "^d" | wc -l')
|
|
16
|
+
if args.command == 'ls-file':
|
|
17
|
+
os.system('ls -l | grep "^-" | wc -l')
|
|
18
|
+
# `kill`
|
|
19
|
+
elif args.command == 'kill':
|
|
20
|
+
os.system('ps -ef | grep ' + args.key + ' | grep -v grep | cut -c 9-16 | xargs kill -9')
|
|
21
|
+
|
|
22
|
+
if __name__ == '__main__':
|
|
23
|
+
main()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: linux-command
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: A command line tool to perform custom tasks.
|
|
5
|
+
Home-page: https://github.com/yourusername/mycommand
|
|
6
|
+
Author: Mouxiao Huang
|
|
7
|
+
Author-email: huangmouxiao@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# linux-command: Linux Command
|
|
15
|
+
|
|
16
|
+
`linux-command` 是一个用于执行特定命令行任务的工具。
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install linux-command
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 使用
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cmd ls-dir
|
|
28
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
setup.py
|
|
3
|
+
linux_command/__init__.py
|
|
4
|
+
linux_command/linux_command.py
|
|
5
|
+
linux_command.egg-info/PKG-INFO
|
|
6
|
+
linux_command.egg-info/SOURCES.txt
|
|
7
|
+
linux_command.egg-info/dependency_links.txt
|
|
8
|
+
linux_command.egg-info/entry_points.txt
|
|
9
|
+
linux_command.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
linux_command
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='linux-command', # 包名
|
|
5
|
+
version='0.0.0', # 版本号
|
|
6
|
+
packages=find_packages(),
|
|
7
|
+
entry_points={
|
|
8
|
+
'console_scripts': [
|
|
9
|
+
'cmd=linux_command.linux_command:main', # 定义命令行工具
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
install_requires=[], # 依赖的包,如果有的话
|
|
13
|
+
author='Mouxiao Huang',
|
|
14
|
+
author_email='huangmouxiao@gmail.com', # 作者邮箱
|
|
15
|
+
description='A command line tool to perform custom tasks.',
|
|
16
|
+
long_description=open('README.md').read(),
|
|
17
|
+
long_description_content_type='text/markdown',
|
|
18
|
+
url='https://github.com/yourusername/mycommand', # 项目地址,假设托管在 GitHub 上
|
|
19
|
+
classifiers=[
|
|
20
|
+
'Programming Language :: Python :: 3',
|
|
21
|
+
'License :: OSI Approved :: MIT License',
|
|
22
|
+
'Operating System :: OS Independent',
|
|
23
|
+
],
|
|
24
|
+
python_requires='>=3.6',
|
|
25
|
+
)
|