From 3ff91ed0a745f106f620a7c683e02ce62f755a2d Mon Sep 17 00:00:00 2001 From: Ivan Tkachev Date: Wed, 20 Sep 2023 18:09:40 +0300 Subject: [PATCH] Fix #7 --- default.nix | 6 +++--- tab.cc | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index cce62e8..3797308 100644 --- a/default.nix +++ b/default.nix @@ -4,12 +4,12 @@ with pkgs; gcc12Stdenv.mkDerivation { name = "tab"; - version = "9.2"; + version = "9.3"; src = ./.; nativeBuildInputs = [ python3 ]; buildPhase = '' - make - STATIC_LIBS=-L${glibc.static}/lib make tab-static + make -B + STATIC_LIBS=-L${glibc.static}/lib make -B tab-static ''; installPhase = '' mkdir -p $out/bin diff --git a/tab.cc b/tab.cc index 64b6f90..9da2c2a 100644 --- a/tab.cc +++ b/tab.cc @@ -17,7 +17,7 @@ std::istream& file_or_stdin(const std::string& file) { throw std::runtime_error("Could not open input file: " + file); return ret; -} +} #ifdef _REENTRANT #include "threaded.h" @@ -61,6 +61,7 @@ void show_help(const std::string& help_section) { "Usage: tab [-i inputdata_file] [-f expression_file] [-t N] [-r random seed] [-s] [-v|-vv|-vvv] [-h section] " << "" << std::endl + << " -V, --version: show version." << std::endl << " -i: read data from this file instead of stdin." << std::endl << " -f: prepend code from this file to " << std::endl << " -p: use this code as the prelude; this code will be prepended to code from file and command line args." << std::endl @@ -175,6 +176,10 @@ int main(int argc, char** argv) { nthreads = std::stoul(out); #endif + } else if (arg == "-V" || arg == "--version") { + std::cout << "tab 9.3" << std::endl << " →→→ https://github.com/ivan-tkatchev/tab/" << std::endl; + return 0; + } else { has_program = true;