mirror of
https://github.com/chubin/cheat.sh.git
synced 2024-11-26 11:09:22 +03:00
Integrated chmod.sh
This commit is contained in:
parent
490821c039
commit
6c14dc98da
@ -140,3 +140,28 @@ class AdapterOeis(CommandAdapter):
|
|||||||
|
|
||||||
def is_found(self, topic):
|
def is_found(self, topic):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
class AdapterChmod(CommandAdapter):
|
||||||
|
"""
|
||||||
|
Show chmod numeric values and strings
|
||||||
|
Exported as: "/chmod/NUMBER"
|
||||||
|
"""
|
||||||
|
|
||||||
|
_adapter_name = "chmod"
|
||||||
|
_output_format = "text"
|
||||||
|
_cache_needed = True
|
||||||
|
_command = ["share/adapters/chmod.sh"]
|
||||||
|
|
||||||
|
def _get_command(self, topic, request_options=None):
|
||||||
|
cmd = self._command[:]
|
||||||
|
if not cmd[0].startswith("/"):
|
||||||
|
cmd[0] = _get_abspath(cmd[0])
|
||||||
|
|
||||||
|
# cut chmod/ off
|
||||||
|
if topic.startswith("chmod/"):
|
||||||
|
topic = topic[4:]
|
||||||
|
|
||||||
|
return cmd + [topic]
|
||||||
|
|
||||||
|
def is_found(self, topic):
|
||||||
|
return True
|
||||||
|
@ -86,6 +86,7 @@ _CONFIG = {
|
|||||||
"learnxiny",
|
"learnxiny",
|
||||||
"rfc",
|
"rfc",
|
||||||
"oeis",
|
"oeis",
|
||||||
|
"chmod",
|
||||||
],
|
],
|
||||||
"adapters.mandatory": [
|
"adapters.mandatory": [
|
||||||
"search",
|
"search",
|
||||||
@ -116,6 +117,7 @@ _CONFIG = {
|
|||||||
("^[^/]*/rosetta(/|$)", "rosetta"),
|
("^[^/]*/rosetta(/|$)", "rosetta"),
|
||||||
("^rfc/", "rfc"),
|
("^rfc/", "rfc"),
|
||||||
("^oeis/", "oeis"),
|
("^oeis/", "oeis"),
|
||||||
|
("^chmod/", "chmod"),
|
||||||
("^:", "internal"),
|
("^:", "internal"),
|
||||||
("/:list$", "internal"),
|
("/:list$", "internal"),
|
||||||
("/$", "cheat.sheets dir"),
|
("/$", "cheat.sheets dir"),
|
||||||
|
Loading…
Reference in New Issue
Block a user