private.h 807 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <faux/list.h>
  2. #include <klish/ktp.h>
  3. #include <klish/ktp_session.h>
  4. #ifndef VERSION
  5. #define VERSION "1.0.0"
  6. #endif
  7. #define DEFAULT_CFGFILE "/etc/klish/klish.conf"
  8. #define DEFAULT_PAGER "/usr/bin/less -I -F -e -X -K -d -R"
  9. #define OBUF_LIMIT 65536
  10. /** @brief Command line and config file options
  11. */
  12. struct options {
  13. bool_t verbose;
  14. char *cfgfile;
  15. bool_t cfgfile_userdefined;
  16. char *unix_socket_path;
  17. char *pager;
  18. bool_t pager_enabled;
  19. bool_t stop_on_error;
  20. bool_t dry_run;
  21. bool_t quiet;
  22. faux_list_t *commands;
  23. faux_list_t *files;
  24. };
  25. // Options
  26. void help(int status, const char *argv0);
  27. struct options *opts_init(void);
  28. void opts_free(struct options *opts);
  29. int opts_parse(int argc, char *argv[], struct options *opts);
  30. bool_t config_parse(const char *cfgfile, struct options *opts);