SDCV(1)

πŸ“¦
version 0.5.5 Β· 2 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ SDCV(1) β€” the manual page, but make it cute ✨

okay so bestie, this is the manual for sdcv, which lives in section 1 of the General Commands Manual. it's giving classic Unix energy, and honestly? we're obsessed. let's get into it πŸ’–


🌸 NAME 🌸

sdcv β€” console version of StarDict program

like, the StarDict vibe but for your terminal. no GUI, no nonsense, just words. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

sdcv [ options ] [list of words]

that's it. that's the whole shape of it. options, then words. iconic.


πŸ’… DESCRIPTION πŸ’…

<pink>sdcv</pink> is a simple, cross-platform text-based utility for working with dictionaries in <purple>StarDict format</purple>. lowkey a whole bestie in a terminal. 🫢

so every single word in that <lavender>"list of words"</lavender> can be a few different flavors, and the first character tells you which one:

  • a string with a leading <hotpink>'/'</hotpink> β†’ uses the Fuzzy search algorithm (for when you're like "idk the spelling bestie, just find it")
  • a string with a leading <hotpink>'|'</hotpink> β†’ uses full-text search (deep dive mode πŸ”)
  • and the string may also contain <hotpink>'?'</hotpink> and <hotpink>'*'</hotpink> β†’ that's regexp search for the pattern-matching girlies ✨

it works in <mint>interactive</mint> and <mint>non-interactive</mint> mode, both. versatile queen.

to exit from interactive mode, press <yellow>Ctrl+D</yellow>. that's the way out, don't panic. πŸšͺ

and in interactive mode, if sdcv was compiled with <cyan>readline</cyan> library support, you can use the <yellow>UP</yellow> and <yellow>DOWN</yellow> keys to cycle through history. yes, like scrolling your old texts. nostalgic. 😭


✨ OPTIONS ✨

one bullet per flag, no skipping, we keep every single one fr fr πŸ’―

  • -h, --help β€” display the help message and dip (exit). classic.
  • -v, --version β€” display the version and exit. flex the build. πŸ‘‘
  • -l, --list-dicts β€” display the list of available dictionaries and exit.
  • -u, --use-dict filename β€” for the search, use only the dictionary with this bookname. just the one. monogamous search energy πŸ’œ
  • -n, --non-interactive β€” for use in scripts. no chatting, just results.
  • -x, --only-data-dir β€” for use in scripts: only use the dictionaries in data-dir, do not search in user and system directories. stay in your lane (affectionate).
  • -e, --exact-search β€” do not fuzzy-search for similar words, only return exact matches. we're being precise today, bestie.
  • -j, --json β€” print the results of <lavender>list-dicts</lavender> and searches as <cyan>json</cyan>, not as plain text. for use in automatically processing the results of a dictionary lookup. robots love this one πŸ€–
  • --utf8-output β€” force sdcv to not convert to locale charset, output in <cyan>utf8`.
  • --utf8-input β€” force sdcv to not convert from locale charset, assume that input is in <cyan>utf8</cyan>.
  • --data-dir path/to/directory β€” use this directory as the path to the <purple>stardict data directory</purple>. this means that sdcv searches for dictionaries in <hotpink>data-dir/dic</hotpink> directory. yes, it appends the /dic. that's the whole point. πŸ—‚οΈ
  • --color β€” use <rainbow>ANSI escape codes</rainbow> for colorizing sdcv output (does not work with json output). cute but incompatible, pick a struggle πŸ˜”

πŸ“ FILES πŸ“

  • /usr/share/stardict/dic
  • $(XDG_DATA_HOME)/stardict/dic

place where sdcv expects to find dictionaries. and here's the tea: instead of <hotpink>/usr/share/stardict/dic</hotpink> you can use any directory you want, just set the <purple>STARDICT_DATA_DIR</purple> environment variable. for example, if you have dictionaries in <hotpink>/mnt/data/stardict-dicts/dic</hotpink>, set <purple>STARDICT_DATA_DIR</purple> to <hotpink>/mnt/data/stardict-dicts</hotpink>. see how it doesn't include the /dic? yeah. iykyk. πŸ’…

  • $(XDG_DATA_HOME)/sdcv_history

this file includes the last <purple>$(SDCV_HISTSIZE)</purple> words which you sought with sdcv. sdcv uses this file only if it was compiled with <cyan>readline</cyan> library support. conditional file, main character energy. ✨

  • $(XDG_CONFIG_HOME)/sdcv_ordering

this is a text file containing one dictionary bookname per line. it specifies in which order the results of a search should be shown. you're literally the director of this search. 🎬


🌈 ENVIRONMENT 🌈

environment variables used by sdcv:

  • STARDICT_DATA_DIR β€” if set, sdcv uses this variable as the data directory; this means that sdcv searches dictionaries in <hotpink>$STARDICT_DATA_DIR/dic</hotpink>.
  • SDCV_HISTSIZE β€” if set, sdcv writes in <hotpink>$(XDG_DATA_HOME)/sdcv_history</hotpink> (or <hotpink>$(SDCV_HISTFILE)</hotpink>) the last <purple>$(SDCV_HISTSIZE)</purple> words which you look up using sdcv. if it is not set, then the last <yellow>2000</yellow> words are saved in <hotpink>$(XDG_DATA_HOME)/sdcv_history</hotpink>. two thousand. that's a lot of words bestie. 😭
  • SDCV_HISTFILE β€” if set, sdcv writes it's history to <hotpink>$(SDCV_HISTFILE)</hotpink>. if it is not set, then the default <hotpink>$(XDG_DATA_HOME)/sdcv_history</hotpink> path will be used.
  • SDCV_PAGER β€” if <purple>SDCV_PAGER</purple> is set, its value is used as the name of the program to use to display the dictionary article. your pager, your rules. 🫢

πŸ’€ BUGS πŸ’€

email bug reports to <hotpink>dushistov at mail dot ru</hotpink>. and be sure to include the word <yellow>"sdcv"</yellow> somewhere in the <yellow>"Subject:"</yellow> field. not in the body. in the Subject:. they mean it. πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

Evgeniy A. Dushistov, Hu Zheng


🌟 SEE ALSO 🌟

stardict(1), <blue>http://sdcv.sourceforge.net/</blue>, <blue>http://stardict.sourceforge.net</blue>


lowkey go read those other pages too. cross-referencing is self care. πŸ“šβœ¨

and that's the whole page, bestie β€” this was <rainbow>sdcv-0.4.2</rainbow>, dated <yellow>2006-04-24</yellow>. she's been iconic since '06 and she's still slaying πŸ’–πŸŽ€πŸ¦‹