•  


Command name alias: ast-grep and sg · Issue #56 · ast-grep/ast-grep · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command name alias: ast-grep and sg #56

Closed
bodograumann opened this issue Sep 23, 2022 · 6 comments
Closed

Command name alias: ast-grep and sg #56

bodograumann opened this issue Sep 23, 2022 · 6 comments

Comments

@bodograumann
Copy link

The cli command name sg is already taken by a shadow tools command

NAME
sg - execute command as different group ID

Cf. https://github.com/shadow-maint/shadow

It is installed by default in /usr/bin/sg at least on arch-linux.

Weirdly npm install -g @ast-grep/cli didn’t even install the cli in ~/.local/bin for me (I have prefix=~/.local configured for npm). Maybe that is also due to the name collision.

I actually like the pattern of .g for grep commands. Pitty that ag is already taken.
How about cg for code-grep?

@HerringtonDarkholme
Copy link
Member

Renaming the command will involve rebranding which I would want to avoid.
However, I can add a tip in README for renaming the command.

@splitDEV
Copy link

Thank you for your awesome tool. I'm testing it right know and already liking it.
But I get the name clash on Linux as well. Always writing ~/.cargo/bin/sg is tedious. And changing PATH order ( ~/cargo/bin before /usr/bin ) is not an option as it is really dangerous.

As the tool is relative new, I would strongly consider renaming it now. It hurts, sure, but renaming will get harder and harder in the future when it has gained more traction (which it will/has already).
Renaming it will always be a question/request and could become a necessity for wider adoption/less complaints.

Maybe seg or smg ? Maybe just create a link to sg or create a second binary with a new name?

@cyrozap
Copy link

+1 to renaming the tool and re-branding sooner rather than later. Judging by the commit history, this project seems to be less than a year old, so changing the name now will be so, so much less painful than it will be to do so later. The original sg is at least 16 years old and seems to be required as part of the base system on Debian and Arch Linux (and possibly others as well, but I haven't checked), so it's only a matter of time until the name conflict starts causing problems for people.

Maybe it could be renamed to astg ? Or maybe it could be called by the full name, ast-grep , and if users want a shorter name they could rename or symlink the binary or add a shell alias to whatever name they like.

@HerringtonDarkholme
Copy link
Member

Good advice! I will try to ship two commands in the installation, one is sg and another is ast-grep .
This backward-compatible way should solve the pain point for Linux users!

@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented May 12, 2023

Thank you for your suggestion! ast-grep v5 now adds both ast-grep and sg as binary names!

@splitDEV
Copy link

This is awesome, thank you very much!

Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본