#pragma once #include "config.h" #include #include #include #include /* Before 4.7, gcc's std::exception uses empty throw() specifiers for * its (virtual) destructor and what() in c++11 mode, in violation of spec */ #ifdef __GNUC__ #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) #define EXCEPTION_NEEDS_THROW_SPEC #endif #endif namespace nix { /* Inherit some names from other namespaces for convenience. */ using std::string; using std::list; using std::set; using std::vector; using boost::format; struct FormatOrString { string s; FormatOrString(const string & s) : s(s) { }; FormatOrString(const format & f) : s(f.str()) { }; FormatOrString(const char * s) : s(s) { }; }; /* BaseError should generally not be caught, as it has Interrupted as a subclass. Catch Error instead. */ class BaseError : public std::exception { protected: string prefix_; // used for location traces etc. string err; public: unsigned int status; // exit status BaseError(const FormatOrString & fs, unsigned int status = 1); #ifdef EXCEPTION_NEEDS_THROW_SPEC ~BaseError() throw () { }; const char * what() const throw () { return err.c_str(); } #else const char * what() const noexcept { return err.c_str(); } #endif const string & msg() const { return err; } const string & prefix() const { return prefix_; } BaseError & addPrefix(const FormatOrString & fs); }; #define MakeError(newClass, superClass) \ class newClass : public superClass \ { \ public: \ newClass(const FormatOrString & fs, unsigned int status = 1) : superClass(fs, status) { }; \ }; MakeError(Error, BaseError) class SysError : public Error { public: int errNo; SysError(const FormatOrString & fs); }; typedef list Strings; typedef set StringSet; /* Paths are just strings. */ typedef string Path; typedef list Paths; typedef set PathSet; typedef enum { lvlError = 0, lvlInfo, lvlTalkative, lvlChatty, lvlDebug, lvlVomit } Verbosity; } u?id=9b049de84ed101e2c0a5d071e76f424b3bc46bd9'>gnu/packages/shellutils.scm
AgeCommit message (Expand)Author
2020-05-16gnu: zsh-autosuggestions: Update to 0.6.4....* gnu/packages/shellutils.scm (zsh-autosuggestions): Update to 0.6.4. Tobias Geerinckx-Rice
2020-05-13gnu: hstr: Update to 2.2....* gnu/packages/shellutils.scm (hstr): Update to 2.2. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Michael Rohleder
2019-11-24gnu: Add shell-functools....* gnu/packages/shellutils.scm (shell-functools): New variable. Oleg Pykhalov
2019-11-13gnu: hstr: Don't use unstable tarball....* gnu/packages/shellutils.scm (hstr)[source]: Download using git-fetch. Efraim Flashner
2019-09-13gnu: shellutils.scm: Sort module inputs....* gnu/packages/shellutils.scm: Sort module inputs alphabetically. Efraim Flashner
2019-09-13gnu: Add zsh-autosuggestions....* gnu/packages/shellutils.scm (zsh-autosuggestions): New variable. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Collin J. Doering
2019-09-13gnu: Add sh-z shell tool...* gnu/packages/shellutils.scm (sh-z): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Collin J. Doering