#getopts

2025-06-09

getopts: как писать CLI-утилиты с флагами без внешних библиотек

Привет, Хабр! getopts — это встроенный в любой POSIX-совместимый Linux/Unix-shell мини-парсер аргументов. Один shebang — и у вас CLI-утилита без единой внешней зависимости. В статье рассмотрим, как выжать из getopts максимум, где он спотыкается и когда пора переехать на getopt или Argbash.

habr.com/ru/companies/otus/art

#linux #shell #bash #getopts #clitools

Old Hacker Public Radiohpr@botsin.space
2024-04-03

New Episode: hpr4088 :: Today I Learnt more Bash tips

Hosted by Some Guy On The Internet on 2024-04-03 is flagged as Clean and is released under a CC-BY-SA license.

Tags: #BashTips, TTIL, #getopts.

hackerpublicradio.org/eps/hpr4

2023-04-25

@podfeet @bbusschots wow! It just blew up when I did an integration test.
But I wrote solid unit test. There must be something that has to do with loading a file using the source command and maybe at overwrites some variables. Still researching it. #bash #ProgrammingByStealth #getopts #unittest #integrationtest #PBS149

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst