Skip to content

Commit

Permalink
fixed build script. no search configuration suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
speckdavid committed Jul 19, 2024
1 parent 0bfcadb commit 004c98b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 7 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _format_args(self, action, default_metavar):


def parse_args():
description = f"""Build one or more predefined build configurations of Fast Downward. Each build
description = """Build one or more predefined build configurations of Fast Downward. Each build
uses CMake to compile the code. Build configurations differ in the parameters
they pass to CMake. By default, the build uses all available cores if this
number can be determined. Use the "-j" option for CMake to override this
Expand Down Expand Up @@ -89,11 +89,13 @@ def parse_args():
args = parser.parse_args()
return args


def complete_arguments(prefix, parsed_args, **kwargs):
split_args(parsed_args)
unused_configs = set(CONFIGS) - set(parsed_args.config_names)
return sorted([c for c in unused_configs if c.startswith(prefix)])


def get_project_root_path():
import __main__
return os.path.dirname(__main__.__file__)
Expand All @@ -110,6 +112,7 @@ def get_src_path():
def get_build_path(config_name):
return os.path.join(get_builds_path(), config_name)


def try_run(cmd):
print(f'Executing command "{" ".join(cmd)}"')
try:
Expand All @@ -122,6 +125,7 @@ def try_run(cmd):
else:
raise


def build(config_name, configure_parameters, build_parameters):
print(f"Building configuration {config_name}.")

Expand Down Expand Up @@ -160,9 +164,9 @@ def split_args(args):
def main():
args = parse_args()
split_args(args)
for config_name in args.config_names:
for config_name in args.config_names or [DEFAULT_CONFIG_NAME]:
build(config_name, CONFIGS[config_name],
args.build_parameters or [DEFAULT_CONFIG_NAME])
args.build_parameters)


if __name__ == "__main__":
Expand Down
8 changes: 3 additions & 5 deletions src/search/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ static vector<string> complete_args(
/* We want no suggestions and expect an integer
but we cannot avoid the default bash completion. */
} else if (last_arg == "--search") {
// suggestions in search string based on current_word
plugins::Registry registry = plugins::RawRegistry::instance()->construct_registry();
for (const shared_ptr<const plugins::Feature> &feature : registry.get_features()) {
suggestions.push_back(feature->get_key() + "(");
}
/* Return suggestions for the search string based on current_word.
Not implemented at the moment. */
exit(1);
} else {
// not completing an argument
suggestions.push_back("--help");
Expand Down

0 comments on commit 004c98b

Please sign in to comment.