61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
/**
|
|
roflcat
|
|
Copyright (C) 2019 rexy712
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef CMD_HPP
|
|
#define CMD_HPP
|
|
|
|
#include <vector> //std::vector
|
|
#include <cstddef> //size_t
|
|
|
|
struct cmd_options{
|
|
const char* lopt;
|
|
char sopt;
|
|
const char* desc;
|
|
};
|
|
|
|
extern const cmd_options cmd_arguments_list[];
|
|
extern const size_t cmd_arguments_list_size;
|
|
|
|
|
|
#define PRINT_LINE_NEVER 0
|
|
#define PRINT_LINE_ALWAYS 1
|
|
#define PRINT_LINE_NONBLANK 2
|
|
|
|
|
|
//struct of command line options/values
|
|
struct cmd_args{
|
|
std::vector<const char*> filenames;
|
|
float freq = 0.2f;
|
|
float spread = 0.3f;
|
|
long seed = 0;
|
|
unsigned number:2;
|
|
unsigned ends:1;
|
|
unsigned squeeze:1;
|
|
unsigned tabs:1;
|
|
unsigned nonprinting:1;
|
|
unsigned usage:1;
|
|
unsigned version:1;
|
|
|
|
cmd_args(void)noexcept;
|
|
void clear_gnu_options(void);
|
|
};
|
|
|
|
cmd_args process_cmd_args(int argc, char** argv);
|
|
|
|
#endif
|