-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb62797
commit 0d23608
Showing
6 changed files
with
155 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
@author : Hu Ji | ||
@file : __main__.py.py | ||
@time : 2024/8/8 17:34 | ||
@site : https://github.com/ice-black-tea | ||
@software: PyCharm | ||
,----------------, ,---------, | ||
,-----------------------, ," ,"| | ||
," ,"| ," ," | | ||
+-----------------------+ | ," ," | | ||
| .-----------------. | | +---------+ | | ||
| | | | | | -==----'| | | ||
| | $ sudo rm -rf / | | | | | | | ||
| | | | |/----|`---= | | | ||
| | | | | ,/|==== ooo | ; | ||
| | | | | // |(((( [33]| ," | ||
| `-----------------' |," .;'| |(((( | ," | ||
+-----------------------+ ;; | | |," | ||
/_)______________(_/ //' | +---------+ | ||
___________________________/___ `, | ||
/ oooooooooooooooo .o. oooo /, `,"----------- | ||
/ ==ooooooooooooooo==.o. ooo= // ,``--{)B ," | ||
/_==__==========__==_ooo__ooo=_/' /___________," | ||
""" | ||
|
||
import sys | ||
|
||
from ..types import Error | ||
|
||
if __name__ == '__main__': | ||
|
||
index = 1 | ||
|
||
if len(sys.argv) <= index: | ||
raise Error("Invalid arguments: missing type") | ||
type = sys.argv[index] | ||
index += 1 | ||
|
||
if type == "tool": | ||
from linktools import environ | ||
|
||
if len(sys.argv) <= index: | ||
raise Error("Invalid arguments: missing name") | ||
name = sys.argv[index] | ||
index += 1 | ||
|
||
exit( | ||
environ.get_tool(name, cmdline=None) | ||
.popen(*sys.argv[index:]) | ||
.call() | ||
) | ||
|
||
raise Error(f"Invalid arguments: unknown type `{type}`") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
@author : Hu Ji | ||
@file : stub.py | ||
@time : 2024/8/6 16:34 | ||
@site : https://github.com/ice-black-tea | ||
@software: PyCharm | ||
,----------------, ,---------, | ||
,-----------------------, ," ,"| | ||
," ,"| ," ," | | ||
+-----------------------+ | ," ," | | ||
| .-----------------. | | +---------+ | | ||
| | | | | | -==----'| | | ||
| | $ sudo rm -rf / | | | | | | | ||
| | | | |/----|`---= | | | ||
| | | | | ,/|==== ooo | ; | ||
| | | | | // |(((( [33]| ," | ||
| `-----------------' |," .;'| |(((( | ," | ||
+-----------------------+ ;; | | |," | ||
/_)______________(_/ //' | +---------+ | ||
___________________________/___ `, | ||
/ oooooooooooooooo .o. oooo /, `,"----------- | ||
/ ==ooooooooooooooo==.o. ooo= // ,``--{)B ," | ||
/_==__==========__==_ooo__ooo=_/' /___________," | ||
""" | ||
import sys | ||
|
||
from ..types import Error | ||
|
||
if __name__ == '__main__': | ||
|
||
index = 1 | ||
|
||
if len(sys.argv) <= index: | ||
raise Error("Invalid arguments: missing type") | ||
type = sys.argv[index] | ||
index += 1 | ||
|
||
if type == "tool": | ||
from linktools import environ | ||
|
||
if len(sys.argv) <= index: | ||
raise Error("Invalid arguments: missing name") | ||
name = sys.argv[index] | ||
index += 1 | ||
|
||
exit( | ||
environ.get_tool(name, cmdline=None) | ||
.popen(*sys.argv[index:]) | ||
.call() | ||
) | ||
|
||
raise Error(f"Invalid arguments: unknown type `{type}`") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters