1
1
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:
Your Name 2020-05-29 12:39:16 -04:00
parent 490821c039
commit 6c14dc98da
2 changed files with 27 additions and 0 deletions

View File

@ -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

View File

@ -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"),