Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[FEATURE] file validators should handle stdin and stdout properly

Aperta
#124 10 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp
Ambito
cli

Direzione di ricerca

Start by locating input_file_validator and its related validation tests or documentation, then reproduce the failures with "-" and "/dev/stdin" on the current main. Done means the supported stdin/stdout values are accepted without extension checks, with the intended handling of FIFOs clarified before implementation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature/proposal ready to tackle
Does this problem persist on the current main?
  • I have verified the issue on the current main
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

Passing "-" to an input_file_validator fails with

what():  Validation failed for positional option 1: The file "-" does not exist!`

Passing "/dev/stdin" also fails:

what():  Validation failed for positional option 1: Expected a regular file "/dev/stdin"!
Expected Behavior

Both of these values should work.

Both of them should also be exempt from extension-checks (or there should be another validator called input_file_or_stdin_validator or maybe even just input_validator because it covers all possible inputs?).

P.S.: independent of "/dev/stdout", I think it is too restrictive to only allow regular files. Being able to open FIFOs is useful, too.

Steps To Reproduce

try it :)

Environment
- Operating system: Ubuntu 22.04
- Sharg version: 89bb8e71172ceea20b95beed5e071fe62b13d91c
- Compiler: gcc-11.3
Anything else?

I like the config being switched to designated initialisers 👍🏻

Suggestion: the documentation would be easier to read if validators and exceptions were in their own folder, because there would be fewer items cluttering the top-level of the documentation. They could even have their own namespace (sharg::validator::input_file ...).

Lingua principale
C++
Stelle
11
Fork
9
Merge medio
8h 34m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di seqan/sharg-parser

Tutte le issue di seqan/sharg-parser

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.