|
From: | Jim Porter |
Subject: | bug#58899: [PATCH v1] Add the "doas" alias to eshell. |
Date: | Sun, 30 Oct 2022 14:51:26 -0700 |
This patch adds a “doas” command alias to eshell for users who prefer doas, similar to the existing “su” and “sudo” command aliases.
Thanks. I think this would be a good addition to Eshell.
I'm unsare whether to use “TRAMP” or “Tramp” spelling. The existing routines in the file use the former, but I've been informed the latter is correct. A future patch should make all spellings (at least within this module) consistent.
I'd say go with "Tramp" like you did in your patch. Since you're modifying code near most of the existing usages of "TRAMP", now would probably be a good time to fix that everywhere in the file too.
Additionaly, I've added a function for calculating the remote-path for files accessed with doas. This function is currently limited to *only* doas, because I didn't want to mess with the other su and sudo functions, but there's no reason it can't be shared, and a future patch should implement that sharing if this patch is considered desirable.
Since the 'eshell/doas' and 'eshell/sudo' functions are so similar, I definitely think it would make sense to share as much code as possible here. In particular, you could also add support for "--shell" to 'eshell/sudo'.
There are some existing tests in test/lisp/eshell/em-tramp-tests.el, so I think it should be fairly safe to adjust 'eshell/sudo'; the regression tests should catch any problems. (Well ok, *some* problems.) It would probably be good to add some simple tests for 'eshell/doas' too.
[Prev in Thread] | Current Thread | [Next in Thread] |