Skip to content

Commit

Permalink
added stdin detection by hasStdInput()
Browse files Browse the repository at this point in the history
  • Loading branch information
gpertea committed Dec 7, 2020
1 parent 0b9df8a commit d2e14ca
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gffread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@
#define VERSION "0.12.4"

#define USAGE "gffread v" VERSION ". Usage:\n\
gffread <input_gff> [-g <genomic_seqs_fasta> | <dir>] [-s <seq_info.fsize>] \n\
gffread [-g <genomic_seqs_fasta> | <dir>] [-s <seq_info.fsize>] \n\
[-o <outfile>] [-t <trackname>] [-r [[<strand>]<chr>:]<start>..<end> [-R]]\n\
[-CTVNJMKQAFPGUBHZWTOLE] [-w <exons.fa>] [-x <cds.fa>] [-y <tr_cds.fa>]\n\
[--ids <IDs.lst> | --nids <IDs.lst>] [--attrs <attr-list>] [-i <maxintron>]\n\
[--stream] [--bed | --gtf | --tlf] [--table <attrlist>] [--sort-by <ref.lst>]\n\
\n\
[<input_gff>] \n\n\
Filter, convert or cluster GFF/GTF/BED records, extract the sequence of\n\
transcripts (exon or CDS) and more.\n\
By default (i.e. without -O) only transcripts are processed, discarding any\n\
other non-transcript features. Default output is a simplified GFF3 with only\n\
the basic attributes.\n\
\n\
<input_gff> is a GFF file, use '-' for stdin\n\
\n\
Options:\n\
-i discard transcripts having an intron larger than <maxintron>\n\
--ids discard records/transcripts if their IDs are not listed in <IDs.lst>\n\
Expand Down Expand Up @@ -408,7 +406,8 @@ int main(int argc, char* argv[]) {
"sort-alpha;keep-genes;w-nocds;attrs=;w-add=;ids=;nids=0;gtf;keep-comments;keep-exon-attrs;force-exons;t-adopt;gene2exon;"
"ignore-locus;no-pseudo;table=sort-by=hvOUNHPWCVJMKQYTDARSZFGLEBm:g:i:r:s:l:t:o:w:x:y:j:d:");
args.printError(USAGE, true);
if (args.getOpt('h') || args.getOpt("help")) {
int numfiles = args.startNonOpt();
if (args.getOpt('h') || args.getOpt("help") || ( numfiles==0 && !hasStdInput())) {
GMessage("%s",USAGE);
exit(1);
}
Expand Down Expand Up @@ -652,7 +651,6 @@ int main(int argc, char* argv[]) {
//if (f_y!=NULL || f_x!=NULL) wCDSonly=true;
//useBadCDS=useBadCDS || (fgtfok==NULL && fgtfbad==NULL && f_y==NULL && f_x==NULL);

int numfiles = args.startNonOpt();
//GList<GffObj> gfkept(false,true); //unsorted, free items on delete
int out_counter=0; //number of records printed

Expand Down

0 comments on commit d2e14ca

Please sign in to comment.