mirror of
https://github.com/chubin/cheat.sh.git
synced 2024-11-22 18:17:38 +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):
|
||||
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",
|
||||
"rfc",
|
||||
"oeis",
|
||||
"chmod",
|
||||
],
|
||||
"adapters.mandatory": [
|
||||
"search",
|
||||
@ -116,6 +117,7 @@ _CONFIG = {
|
||||
("^[^/]*/rosetta(/|$)", "rosetta"),
|
||||
("^rfc/", "rfc"),
|
||||
("^oeis/", "oeis"),
|
||||
("^chmod/", "chmod"),
|
||||
("^:", "internal"),
|
||||
("/:list$", "internal"),
|
||||
("/$", "cheat.sheets dir"),
|
||||
|
Loading…
Reference in New Issue
Block a user