/* KMPS.h
 *
 * Copyright (C) 2024 OpenKylin, Inc
 */

#ifndef __KMPS_H__
#define __KMPS_H__

#include <optional>

#include "app/KMSubCommand.h"
#include "common/KMOptions.h"

using namespace std;

typedef struct _KMPSInfoList
{
    int64_t pid = 0;
    string appid;
    string containerid;
    string path;
} KMPSInfoList;

/**
 * @brief ``kaiming ps`` 命令可以查看运行中的应用。
 */
class KMPS : public KMSubCommand
{
    DECLARE_DYNCREATE(KMPS);

public:
    KMPS();
    virtual ~KMPS();

    int despose(int argc, char **argv) override;
    void init();
    // int start(const vector<string> &vecName);

protected:
private:
    void printAppInfo(const vector<KMPSInfoList> &psInfos);

private:
    class Options;
    class Private;
    std::shared_ptr<Private> m_dPtr;
};

#endif // __KMPS_H__
