eshaan7 / Flask-Shell2HTTP

Execute shell commands via HTTP server (via flask's endpoints).
https://flask-shell2http.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
174 stars 29 forks source link

use python format function #40

Closed knassar702 closed 2 years ago

knassar702 commented 2 years ago

Hello @eshaan7 thanks for this project I really like it :+1: but I've got a simple question about the command variables, it's possible to use format string in python to select the right place of the variable? for example

>>> command = "curl {url} --timeout {timeout}".format(url="http://google.com/",timeout=20)
"curl http://google.com/ --timeout 20"
eshaan7 commented 2 years ago

Hey, this is currently not supported because it's possible to achieve this functionality in various other ways, such as:

1. Pass everything as args

shell2http.register_command(endpoint="curl", command_name="curl")

2. Using a custom bash script as an intermediary

knassar702 commented 2 years ago

@eshaan7 Thanks :heart: