`is-elevated` command
Open
Nobody has claimed this yet.
Issue-Feature
Needs-Triage
- Dominant language
- Rust
- Stars
- 5.9k
- Forks
- 180
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 2
Description
Description of the new feature / enhancement
Could you please add new is-elevated command.
It should check for elevated permissions and return 0 if process is already elevated.
sudo is-elevated && echo Already elevated
Scenario when this would be used?
This is useful feature and can be used in many scenarios.
For example if will allow to create self-elevated scripts:
test.cmd:
:: check for elevated permissions
:: - if already elevated - continue run
:: - if NOT elevated - elevate myself, run and exit
sudo is-elevated || ( sudo -E "%~sf0" %* & exit /B )
echo Run elevated code here
Supporting information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the command entry point for sudo and the existing Windows permission or elevation checks. Verify how a new is-elevated command should return status 0 when already elevated, then test it from the batch scenarios shown in the issue, including both elevated and non-elevated processes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100