mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
split command in different files
This commit is contained in:
parent
d40fe8284c
commit
02a8a66424
6
plugins/python/pybeautifyjson.fish
Normal file
6
plugins/python/pybeautifyjson.fish
Normal file
@ -0,0 +1,6 @@
|
||||
# beautify json string
|
||||
# use : pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}'
|
||||
function pybeautifyjson
|
||||
echo $argv | python -mjson.tool
|
||||
end
|
||||
|
10
plugins/python/pyclean.fish
Normal file
10
plugins/python/pyclean.fish
Normal file
@ -0,0 +1,10 @@
|
||||
# clean current directory recursively from any .pyc and .pyo files
|
||||
function pyclean
|
||||
if test -n $argv
|
||||
set path2CLEAN $argv
|
||||
else
|
||||
set path2CLEAN .
|
||||
end
|
||||
|
||||
find $path2CLEAN -name "*.pyc" -delete -o -name "*.pyo" -delete
|
||||
end
|
9
plugins/python/pyhttp.fish
Normal file
9
plugins/python/pyhttp.fish
Normal file
@ -0,0 +1,9 @@
|
||||
# start in-place a simple http server, take a optional parameter for the port number
|
||||
function pyhttp
|
||||
if test -n "$argv"
|
||||
set HTTPPORT $argv
|
||||
else
|
||||
set HTTPPORT 1025
|
||||
end
|
||||
python -m SimpleHTTPServer $HTTPPORT;
|
||||
end
|
10
plugins/python/pysmtp.fish
Normal file
10
plugins/python/pysmtp.fish
Normal file
@ -0,0 +1,10 @@
|
||||
# start smtp debugging server, can pass an option port parameter. Default to 1025
|
||||
function pysmtp
|
||||
if test -n "$argv"
|
||||
set SMTPPORT $argv
|
||||
else
|
||||
set SMTPPORT 1025
|
||||
end
|
||||
echo "smtp server started on port" $SMTPPORT;
|
||||
python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT;
|
||||
end
|
@ -2,41 +2,3 @@ if test -d /usr/local/share/python
|
||||
set PATH /usr/local/share/python $PATH
|
||||
end
|
||||
|
||||
|
||||
# clean current directory recursively from any .pyc and .pyo files
|
||||
function pyclean
|
||||
if test -n $argv
|
||||
set path2CLEAN $argv
|
||||
else
|
||||
set path2CLEAN .
|
||||
end
|
||||
|
||||
find $path2CLEAN -name "*.pyc" -delete -o -name "*.pyo" -delete
|
||||
end
|
||||
|
||||
# start smtp debugging server, can pass an option port parameter. Default to 1025
|
||||
function pysmtp
|
||||
if test -n "$argv"
|
||||
set SMTPPORT $argv
|
||||
else
|
||||
set SMTPPORT 1025
|
||||
end
|
||||
python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT;
|
||||
end
|
||||
|
||||
|
||||
# beautify json string
|
||||
# use : pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}'
|
||||
function pybeautifyjson
|
||||
echo $argv | python -mjson.tool
|
||||
end
|
||||
|
||||
# start in-place a simple http server, take a optional parameter for the port number
|
||||
function pyhttp
|
||||
if test -n "$argv"
|
||||
set HTTPPORT $argv
|
||||
else
|
||||
set HTTPPORT 1025
|
||||
end
|
||||
python -m SimpleHTTPServer $HTTPPORT;
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user