added a shiny bash-autocomplete script

This commit is contained in:
Jack Andersen 2015-05-19 11:01:32 -10:00
parent d10c3a831d
commit 66d07af26e
12 changed files with 64 additions and 30 deletions

View File

@ -44,7 +44,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short. # quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "High-Level Extensible Combiner Language" PROJECT_BRIEF = "High-Level Extensible Combiner Language and Resource Database"
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included # With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55 # in the documentation. The maximum height of the logo should not exceed 55

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_ADD
#error This file may only be included from main.cpp #define CTOOL_ADD
#endif
#include "CToolBase.hpp" #include "CToolBase.hpp"
@ -15,3 +14,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_ADD

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_BASE
#error This file may only be included from main.cpp #define CTOOL_BASE
#endif
class CToolBase class CToolBase
{ {
@ -12,3 +11,4 @@ public:
virtual ~CToolBase() {} virtual ~CToolBase() {}
}; };
#endif // CTOOL_BASE

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_CLEAN
#error This file may only be included from main.cpp #define CTOOL_CLEAN
#endif
#include "CToolBase.hpp" #include "CToolBase.hpp"
@ -15,3 +14,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_CLEAN

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_COOK
#error This file may only be included from main.cpp #define CTOOL_COOK
#endif
#include "CToolBase.hpp" #include "CToolBase.hpp"
@ -15,3 +14,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_COOK

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_GROUP
#error This file may only be included from main.cpp #define CTOOL_GROUP
#endif
#include "CToolBase.hpp" #include "CToolBase.hpp"
@ -15,3 +14,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_GROUP

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_HELP
#error This file may only be included from main.cpp #define CTOOL_HELP
#endif
#include "CToolBase.hpp" #include "CToolBase.hpp"
@ -15,3 +14,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_HELP

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_INIT
#error This file may only be included from main.cpp #define CTOOL_INIT
#endif
#include "CToolBase.hpp" #include "CToolBase.hpp"
@ -15,3 +14,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_INIT

View File

@ -1,6 +1,5 @@
#ifndef MAIN_CPP #ifndef CTOOL_PACKAGE
#error This file may only be included from main.cpp #define CTOOL_PACKAGE
#endif
#include <vector> #include <vector>
#include <string> #include <string>
@ -17,3 +16,5 @@ public:
{ {
} }
}; };
#endif // CTOOL_PACKAGE

View File

@ -3,6 +3,7 @@
#include <HECLDatabase.hpp> #include <HECLDatabase.hpp>
#define MAIN_CPP #define MAIN_CPP
#include "CToolBase.hpp"
#include "CToolInit.hpp" #include "CToolInit.hpp"
#include "CToolAdd.hpp" #include "CToolAdd.hpp"
#include "CToolGroup.hpp" #include "CToolGroup.hpp"

26
hecl/extra/hecl_autocomplete.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
_hecl ()
{
local word=${COMP_WORDS[COMP_CWORD]}
local filecmds=(init add group cook clean package)
if [ $COMP_CWORD == 1 ]
then
COMPREPLY=($(compgen -W "${filecmds[*]} help" "${word}"))
return 0
elif [ $COMP_CWORD == 2 ]
then
case ${COMP_WORDS[1]} in
init|add|group|cook|clean|package)
COMPREPLY=($(compgen -f -- "${word}"))
;;
help)
COMPREPLY=($(compgen -W "${filecmds[*]}" "${word}"))
;;
esac
fi
}
complete -F _hecl hecl

View File

@ -296,6 +296,11 @@ public:
std::function<void(std::string&, LoadType, unsigned)> feedbackCb, std::function<void(std::string&, LoadType, unsigned)> feedbackCb,
bool recursive=false)=0; bool recursive=false)=0;
/**
* @brief Interrupts a cook in progress (call from SIGINT handler)
*/
virtual void interruptCook()=0;
/** /**
* @brief Delete cooked objects for file or directory * @brief Delete cooked objects for file or directory
* @param path file or directory of intermediates to clean * @param path file or directory of intermediates to clean
@ -304,11 +309,6 @@ public:
*/ */
virtual bool cleanPath(const std::string& path, bool recursive=false)=0; virtual bool cleanPath(const std::string& path, bool recursive=false)=0;
/**
* @brief Interrupts a cook in progress (call from SIGINT handler)
*/
virtual void interruptCook()=0;
}; };
/** /**